import 'package:flutter/cupertino.dart';

class HeaderDelegate extends SliverPersistentHeaderDelegate {
  const HeaderDelegate({required this.child,required this.extent});

  final double extent;
  final Widget child;

  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    return child;
  }

  @override
  double get maxExtent => extent;

  @override
  double get minExtent => extent;

  @override
  bool shouldRebuild(covariant HeaderDelegate oldDelegate) => child!=oldDelegate.child;
}